package com.alibaba.datax.plugin.reader.kafkareader;

import com.alibaba.datax.common.spi.ErrorCode;

/**
 * @Description: TODO
 * @Author: chenweifeng
 * @Date: 2022年09月05日 上午11:14
 **/
public enum KafkaReaderErrorCode implements ErrorCode {
    TOPIC_ERROR("KafkaReader-00", "您没有设置topic参数"),
    PARTITION_ERROR("KafkaReader-01", "您没有设置kafkaPartitions参数"),
    ADDRESS_ERROR("KafkaReader-02", "您没有设置bootstrapServers参数"),
    KAFKA_READER_ERROR("KafkaReader-03", "参数错误"),
    ;


    private final String code;
    private final String description;

    private KafkaReaderErrorCode(String code, String description) {
        this.code = code;
        this.description = description;
    }

    @Override
    public String getCode() {
        return this.code;
    }

    @Override
    public String getDescription() {
        return this.description;
    }

    @Override
    public String toString() {
        return String.format("Code:[%s], Description:[%s].", this.code,
                this.description);
    }
}
